fix(web): correct the reported settings, plan, and update screens - #1370
Conversation
Easee no longer shows a second password bound to the same field. Adding a device scrolls that card into view. Charging without a schedule no longer says the ready time has passed. An empty site does not show a legacy plan. The update dialog shows measured bytes and says when that measurement has stopped.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a547da06e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function configuredDeviceCount(status) { | ||
| const drivers = status && status.drivers; | ||
| if (!drivers) return 0; | ||
| if (Array.isArray(drivers)) return drivers.length; | ||
| if (typeof drivers === 'object') return Object.keys(drivers).length; | ||
| return 0; |
There was a problem hiding this comment.
Count non-Lua devices before showing the empty state
On an OCPP-only installation, OCPP telemetry is stored without a DriverHealth entry, while /api/status.drivers is assembled from AllHealth() plus configured Lua drivers. Consequently this helper returns zero even though a charger and loadpoint exist, causing the plan to be replaced with “No devices yet” and hiding the valid charging plan. Include configured loadpoints/OCPP chargers, or derive this state from configuration rather than only status.drivers.
AGENTS.md reference: AGENTS.md:L24-L25
Useful? React with 👍 / 👎.
| if (configuredDeviceCount(state.status) === 0) { | ||
| ctx.fillStyle = C.dim; | ||
| ctx.font = '14px sans-serif'; | ||
| ctx.fillText('No devices yet. Add one in Settings.', pad.l, pad.t + 28); | ||
| const summary = document.getElementById('plan-summary'); | ||
| if (summary) summary.textContent = 'No devices yet — add a device in Settings, and the plan starts once FTW can see your site.'; | ||
| return; |
There was a problem hiding this comment.
Clear all plan views before returning from the empty state
When a hot config reload removes the last driver, this branch updates only the canvas and summary before returning. It skips renderPlanBrief, renderCarPlans, fallback-alert cleanup, and the later priceBarBounds reset, so the Overview card, plan badge/action, EV timeline, and hover tooltip can continue showing the previous plan while the header says there are no devices. Reset or explicitly render those dependent views in this branch before returning.
AGENTS.md reference: AGENTS.md:L22-L23
Useful? React with 👍 / 👎.
| } else if (lp.commanded_known && !lp.commanded_w && lp.commanded_reason === "no_plan_budget" && !hasSchedule) { | ||
| text = "No schedule set. Create a schedule or charge manually."; | ||
| tone = "var(--text)"; |
There was a problem hiding this comment.
Recognize one-shot targets before declaring no schedule
A supported POST /api/loadpoints/{id}/target can set target_soc and target_time without creating lp.schedule. For such an externally supplied one-shot goal, hasSchedule is false, so this new branch preempts the deadline-aware branch and incorrectly says no schedule exists even while Core is planning toward that target. Treat a valid target/deadline as an active goal here, reserving this copy for loadpoints with neither a schedule nor a one-shot target.
AGENTS.md reference: AGENTS.md:L28-L30
Useful? React with 👍 / 👎.
Summary
config.passwordinput. The Secrets section skips that key when the field is already on the card.no_plan_budgetwithout a schedule says to create a schedule or charge manually. The ready-time sentence stays for a schedule whose time has passed.v0.132.1-beta.1was already publishing from the previous commit, so this follows in the next beta.Test
node --test web/settings/devices-add.test.mjs web/ev-commanded-reason.test.mjs web/plan-empty.test.mjs web/update-progress.test.mjs— 8 passed.No browser on this machine, so the rendered pages were not clicked through.